import { Button } from 'antd'
import React from 'react'

// danger类型的Button
export const DangerButton = ({ style, title, onClick, icon, buttonProps }) => (
  <Button
    style={style}
    type={'danger'}
    icon={icon}
    onClick={onClick}
    {...buttonProps}
  >
    {title || '返回'}
  </Button>
)

// primary类型的Button
export const PrimaryButton = ({ style, icon, onClick, title, buttonProps }) => (
  <Button
    style={style}
    type={'primary'}
    icon={icon}
    onClick={onClick}
    {...buttonProps}
  >
    {title || '确定'}
  </Button>
)

// 查询列表下方的新增(默认带样式和icon)
export const ButtonOfAdd = ({ style, icon, onClick, title, buttonProps }) => (
  <Button
    type={'primary'}
    icon={icon || 'plus'}
    style={style || { marginBottom: 16 }}
    onClick={onClick}
    {...buttonProps}
  >
    {title || '新增'}
  </Button>
)
